import request from '@/utils/request'

export default{
    //条件查询分页
    pageList(pageNum,pageSize,searchObj){
        return request({
            url: `/player/selectPlayerPage/${pageNum}/${pageSize}`,
            method: 'post',
            //使用json格式传递 写法data：searchObj
            //使用j普通格式传递 写法params：searchObj
            data:searchObj
          })
    },
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            
    removePalyerId(id){
        return request({
            url: `/player/deletePlayerById/${id}`,
            method: 'delete',
          })

    },

    savePalyer(player){
        return request({
            url: `/player/insertPlayer`,
            method: 'post',
            data:player
          })
    },

    getPlayerById(id){
        return request({
            url: `/player/getPlayerById/${id}`,
            method: 'get',
          })
    },

    updatePlayer(player){
        return request({
            url: `/player/updatePlayer`,
            method: 'post',
            data:player
          })
    },

    batchRemove(idList) {
        return request({
          url: `/player/removeBatch`,
          method: `delete`,
          data: idList
        })
    },

    retirePlayer(idList){
      return request({
        url: `/player/retirePlayer`,
        method: `post`,
        data: idList
      })
    },
    comebackPlayer(idList){
      return request({
        url: `/player/comebackPlayer`,
        method: `post`,
        data: idList
      })
    },

    selectPlayerAll(){
      return request({
        url: `/player/selectPlayerAll`,
        method: `get`
      })
    },
    getPlayerSpread(){
      return request({
        url: `/player/getPlayerSpread`,
        method: `get`
      })
    },
    getNowPlayerList(){
      return request({
        url: `/player/getNowPlayerList`,
        method: `get`
      })
    },
    getRetirePlayerList(){
      return request({
        url: `/player/getRetirePlayerList`,
        method: `get`
      })
    },
    getPlayerListByCondition(searchObj){
      return request({
        url: `/player/getPlayerListByCondition`,
        method: `post`,
        data: searchObj
      })
    },
}